package com.meowcook.mapper;

import com.meowcook.pojo.dto.LikeCommentDTO;
import com.meowcook.pojo.dto.LikeRecipeDTO;
import com.meowcook.pojo.dto.LikeReplyDTO;
import com.meowcook.pojo.po.LikeComment;
import com.meowcook.pojo.po.LikeRecipe;
import com.meowcook.pojo.po.LikeReply;
import com.meowcook.pojo.vo.LikeCommentVO;
import com.meowcook.pojo.vo.LikeRecipeVO;
import com.meowcook.pojo.vo.LikeReplyVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 28792
 * Date: 2025-05-15
 * Time: 19:00
 */
@Mapper(componentModel = "spring")
public interface LikePojoMapper {
    LikePojoMapper INSTANCE = Mappers.getMapper(LikePojoMapper.class);

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "userId", target = "userId"),
            @Mapping(source = "recipeId", target = "recipeId"),
            @Mapping(source = "isLiked", target = "isLiked")
    })
    LikeRecipe toPO(LikeRecipeDTO likeRecipeDTO);

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "userId", target = "userId"),
            @Mapping(source = "commentId", target = "commentId"),
            @Mapping(source = "isLiked", target = "isLiked")
    })
    LikeComment toPO(LikeCommentDTO likeCommentDTO);

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "userId", target = "userId"),
            @Mapping(source = "replyId", target = "replyId"),
            @Mapping(source = "isLiked", target = "isLiked")
    })
    LikeReply toPO(LikeReplyDTO likeReplyDTO);

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "isLiked", target = "isLiked")
    })
    LikeRecipeVO toVO(LikeRecipe likeRecipe);

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "isLiked", target = "isLiked")
    })
    LikeCommentVO toVO(LikeComment likeComment);

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "isLiked", target = "isLiked")
    })
    LikeReplyVO toVO(LikeReply likeReply);
}
